<template>
    <elm-page-tb>
        <template #top>
          <el-input placeholder="请查询输入内容" prefix-icon='el-icon-search' size="mini" style="width: 250px;" v-model="postData.name" clearable></el-input>
            <right>
                <el-button-group>
                  <el-button icon="el-icon-search" size="mini" @click="tablebinding()">查询</el-button>
                    <elm-open-button url="check_edit" icon="el-icon-edit" title="新增" width="60%" height="50%" :data="{pid: '0'}">新增</elm-open-button>
                </el-button-group>
            </right>
        </template>
        <elm-table url="/business/plm/check/GetData" :post-data="postData" :page-size="50" height="100%">
          <el-table-column prop="product_mc" label="产品" align="center"></el-table-column>
          <el-table-column prop="craft_mc" label="工序" align="center"></el-table-column>
          <el-table-column prop="plan_mc" label="计划" align="center"></el-table-column>
          <el-table-column prop="check_person_mc" label="质检人" align="center"></el-table-column>
          <el-table-column prop="create_time" :formatter="formatDateTime" label="创建时间" align="center" width="160"></el-table-column>
          <el-table-column prop="remark" label="备注" align="center"></el-table-column>
          <el-table-column fixed="right" label="操作" width="120px" align="center">
            <template v-slot="scope">
              <elm-open-button url="check_edit" :title="'编辑'" width="60%" height="50%" :data="{ model: scope.row }" type="text">编辑</elm-open-button>
              <el-button type="text" size="mini" @click="deleteData(scope.row)">删除</el-button>
            </template>
          </el-table-column>
      </elm-table>
    </elm-page-tb>
</template>

<script>
export default {
    extends: elmVueBase,
    data() {
        return {
            postData: {name: null },
        }
    },
    async created() {
    },
    methods: {
        async deleteData(data) {
            await this.delete('/business/plm/check/Delete', { id: data.id });
            this.tablebinding();
        },
    }
}
</script>

<style scoped>
</style>